package com.itheima.mapper;

import com.itheima.entity.YddUser;
import com.itheima.entity.YddUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HomeIndexMapper {

    @Select("select * from ydd_user where mobile = #{loginName}")
    YddUser selectByUserName(String loginName);

    @Select("select * from ydd_user where id = #{id}")
    YddUserInfo selectByUserId(Integer id);

    @Select("select count(*) from ydd_article where author=#{username}")
    Integer getArticleNumByName(String username);

    @Select("select lovenum from ydd_article where author = #{username}")
    List<Integer> getCollectNumByName(String username);

    @Select("select type from ydd_user_data where user_id = #{userId}")
    List<Integer> getZanNumByName(Integer userId);
}
